home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d2 / qad.arc / QAD.DOC < prev    next >
Text File  |  1988-06-04  |  9KB  |  217 lines

  1. Quick And Dirty (QAD), an ASCII to Delimited File Converter.
  2.  
  3. Written and Copyrighted by    Kenneth B. Gash
  4.                               6534 Eddinghill Drive
  5.                               Rancho Palos Verdes, CA 90274
  6.  
  7. I am submitting this utility program as SHAREWARE.  If you find
  8. it as useful as I think you will (presuming you have an
  9. application for it), I would like to know about it.  If you
  10. really like it, then I request that you send me a $15.00
  11. SHAREWARE contribution to help support upgrades and future
  12. programs.  I won't bug you about this, except at the end of these
  13. instructions.  There won't be any OPENING SCREENS with demands
  14. for money staring you in the face every time you run the program. 
  15. (Since the BASIC source code is included, it would do me little
  16. good to try this tactic anyway).
  17.  
  18. Program Description
  19. --------------------
  20.  
  21. This program takes ASCII records conforming to certain simple
  22. rules and allows you to "delimit" those records into whatever
  23. fields you like.  It can be used to convert data obtainable from
  24. mainframe downloads, from data bases and spreadsheets which do
  25. not export files in anything useful except ASCII and for files
  26. ported from other systems as ASCII records.
  27.  
  28. It is entitled Quick And Dirty (QAD) because it was designed to
  29. be a working utility with no bells and whistles.
  30.  
  31. Data bases are wonderful tools for manipulating large amounts of
  32. data, but the data has to be entered before it can be
  33. manipulated.  Usually, the data is entered from the keyboard,
  34. which can be a very tedious process.
  35.  
  36. On the other hand, data is often available as an ASCII list or
  37. table which can be accessed with a word processor and can be sent
  38. to a printer for hard copy.  Unfortunately, it is usually not in
  39. a form which is "importable" by standard data base programs.  I
  40. work at a university and I often access the central mainframe
  41. computer for student and course schedule data.  The people at the
  42. computer center can produce files containing many records of
  43. ASCII data which I would then have to type into my PC for further
  44. analyses and manipulation.  This program is the result of my
  45. frustration with this method of getting data into a data base.
  46.  
  47. Any collection of ASCII data that conforms to some simple rules
  48. can be converted by this program to be imported into dBASE III,
  49. REFLEX, or any other program which can recognize "delimited"
  50. ASCII data files.  A delimited data file is one in which each of
  51. the fields in a record is separated from the next field by one or
  52. more delimiters.  This program uses two delimiters: the comma (,)
  53. and the quotation mark (").  
  54.  
  55. The program also is able to do some manipulation of the data as
  56. it is delimiting it.  One of the most common types of data bases
  57. is a collection of names and addresses (which may also contain
  58. additional data).  In many cases, names are stored in as
  59. LASTNAME,FIRSTNAME MI.  This form is quite useful for sorting of
  60. the lists but it is not very useful for generating mailing lists. 
  61. The program can convert names stored in this form to a delimited
  62. LASTNAME, and a delimited FIRSTNAME MI.  The program is also able
  63. to do "Proper Case Conversion" which means that it will take an
  64. alphanumeric field that contains UPPER CASE STRINGS and convert
  65. it to "Proper Case Strings" where only the first character of
  66. each word is upper case.  This again is useful in converting name
  67. and address files obtained from various sources since they are
  68. often stored as upper case only files.
  69.  
  70. The "Rules" for the file to be converted are:
  71.  
  72.      1.   Each record of the file must be contained in a single
  73.           line with no carriage returns or linefeeds.
  74.  
  75.      2.   Each record of the file must be made up of the same
  76.           number and type of fixed length fields. 
  77.  
  78.      3.   The total number of characters in each record should be
  79.           no more than 240.  This program is written in BASIC
  80.           which limits string length to 255 so 240 is set to
  81.           leave room for the delimiters.
  82.  
  83.      4.   Name fields which are to be delimited into first and
  84.           last name fields MUST have a comma separating the
  85.           LASTNAME and FIRSTNAME in the original field.  The
  86.           program searches for the presence of a comma then
  87.           proceeds to separate the two parts of the name at that
  88.           position.
  89.  
  90.      5.   When Proper Case Conversion is used, it may require
  91.           some touching up with a text editor (Henry Smith Iii or
  92.           Po Box or other minor errors will occur).
  93.  
  94. Using the Program
  95. -----------------
  96.  
  97. THe program was written in BASIC and compiled with Microsoft
  98. Quick Basic 4.0.  I have included the source file in case anyone
  99. wants to modify the program, but the program runs fastest as
  100. QAD.EXE.
  101.  
  102. Enter QAD
  103.  
  104. Enter the full pathname of the file to convert
  105. The program adds the extension .PRN if there was no extension. 
  106. If you don't like the default output file name, change it before
  107. hitting enter.
  108.  
  109. The program then places the first record in the input file on the
  110. screen, gives its length in bytes and asks:
  111.      
  112.      IS THIS A GOOD RECORD (Y OR N)?
  113.  
  114. A "good" record is one which contains few if any null or blank
  115. fields so that it would be useful for marking appropriate fields
  116. for delineating.
  117.  
  118. Once you find a good record and hit 'Y', the record is re-written
  119. on the screen with the cursor activated to mark fields.
  120.  
  121. To mark a field, move the cursor using the left and right arrows
  122. on the number pad so that the cursor is on the character just to
  123. the right of the last character in the field to be marked.
  124.  
  125.      Hit 'C' if you want the field to be separated by a COMMA
  126.  
  127.      Hit 'Q' if you want both quotes and commas.  
  128.  
  129.      Hit 'N' if the field contains a name, WITH A COMMA
  130.      SEPARATING THE TWO PARTS OF THE NAME, and you want the first
  131.      and last names automatically delineated as separate fields. 
  132.      This function uses only the QUOTE and COMMA delineation. 
  133.      This function will cause the program to crash if it is used
  134.      on a field where there is no comma.
  135.  
  136. While marking fields, you can do things like separating area
  137. codes and/or dashes from telephone numbers, mark fields that are
  138. not needed so that they may be discarded by your application
  139. program and shorten the total record by a fixed amount.  The
  140. latter is done by simply not marking the entire record if the
  141. last part of it contains unwanted information.
  142.  
  143. It is important to note that the last field MUST be fully marked. 
  144. Don't worry if it appears to have a trailing comma, that will be
  145. removed in the conversion.
  146.  
  147. As you are marking the fields, you will notice that the Field
  148. Number, Field Length and Total Length Marked are shown on the
  149. screen.  This feature is useful if you know the exact record
  150. layout of the ASCII string you want to delimit and some of the
  151. fields appear blank on the screen.
  152.  
  153. When all fields are marked, hit the ENTER key.  You will then be
  154. asked if you want to do Lower Case Conversion.  If you answer
  155. 'N', you will be presented with a list the fields you have marked
  156. to check.  If everything looks OK, hit the enter key.  If you
  157. detect something wrong, hit the BACKSLASH (\) key to start over. 
  158. This key can be hit any time during the field marking procedure
  159. to abort and start again.  I'm afraid if you want to quit without
  160. actually converting data, you must hit <Ctrl><Break> to get out
  161. of the program.  No frills, remember?
  162.  
  163. If you select Lower Case Conversion, each marked field will be
  164. presented in order and you will be asked to enter 'Y' or 'N'.
  165.  
  166. Finally, when the list is done and you hit the ENTER key, the
  167. conversion begins.  If you have lots of lower case conversions,
  168. the conversion is slowed down somewhat.  
  169.  
  170. Summary
  171. -------
  172.  
  173. 1.   From the directory containing QAD.EXE, enter QAD.
  174.  
  175. 2.   Type in the full pathname of the ASCII file to be converted.
  176.  
  177. 3.   Accept the default output file or type in a new pathname.
  178.  
  179. 4.   Proceed to move the cursor with the arrow keys and mark the
  180.      fields.
  181.  
  182. 5.   When all fields are marked, hit the ENTER key, answer the
  183.      questions about lower case conversions and proceed to get
  184.      your data converted.
  185.  
  186.  
  187.  
  188. Cautions
  189. --------
  190.  
  191. Since there is little or no error checking, your input file must
  192. be "clean" or your output file may wind up with some strange
  193. formats.  Of course, the input file is not changed in any way, so
  194. no real harm done.
  195.  
  196. The values I have chosen for the cursor highlight, foreground and
  197. background and other colors used in marking the fields may not be
  198. fully appropriate for your monitor.  I have checked them on CGA,
  199. EGA, VGA and Hercules type monitors, but variations do exist.  If
  200. that is the case, you should experiment with different values of
  201. the values in LINE 80 and the value of PCOL in line 30. 
  202. Remember, MONO screens (including Hercules) have their screen
  203. memory starting at &HB000 while color screens start at &HB800. 
  204. Of course, you should recompile (using Quick Basic, any version)
  205. for speed.
  206.  
  207. It is not a good idea to use files with the .PRN extension as
  208. input files.  If you do, and you do not rename the DEFAULT output
  209. file, the program will crash since it will try to open the INPUT
  210. file for OUTPUT!
  211.  
  212.  
  213. Final Reminder.
  214. ---------------
  215.  
  216. A $15.00 SHAREWARE contribution is requested if you find this
  217. program useful.  Thanks.